import BasicLayout from "@layout/index";
import { overviewRoute, homeRoute, rootRoute } from "@/routes/config";
export const RootRouteComponent = {
  name: "Overview",
  path: rootRoute,
  component: BasicLayout,
  redirect: () => ({ path: overviewRoute.path }),
};
export const overviewRouteComponent = {
  path: rootRoute,
  name: "overview",
  component: BasicLayout,
  meta: {
    keepAlive: true,
    visible: true,
    title: overviewRoute.meta.title,
    icon: "icon-jichuguanli",
    page_type: 1,
  },
  children: [
    {
      path: "/overview",
      name: "overview",
      meta: {
        icon: "icon-jichuguanli",
        keepAlive: true,
        page_type: 1,
        title: overviewRoute.meta.title,
        visible: true,
      },
      component: () => import("@/views/overview"),
    },
  ],
};
export const HomeRouteComponent = {
  path: "/home",
  redirect: () => {
    return { path: homeRoute.path };
  },
  name: "home",
  component: BasicLayout,
  meta: {
    keepAlive: true,
    visible: true,
    title: $t("base.home"),
    icon: "icon-jichuguanli",
    page_type: 0,
  },
  children: [
    {
      path: homeRoute.path,
      name: homeRoute.name,
      meta: {
        ...homeRoute.meta,
      },
      component: () => import("@home/index"),
    },
  ],
};

export const LoginRouteComponent = {
  name: "Login",
  path: "/login",
  component: () => import("@/views/login/index.vue"),
};

export const PayRouteChildComponent = {
  name: "user-pay",
  path: "/user/grade/pay",
  component: () => import("@user/pay"),
  meta: {
    title: $t(`base.payRecord`),
    visible: false,
    icon: "icon-jichuguanli",
    page_type: 1,
  },
};

export const PayRouteComponent = {
  path: "/user",
  name: "User",
  component: BasicLayout,
  meta: {
    keepAlive: true,
    visible: true,
    title: $t("base.userManage"),
    icon: "icon-jichuguanli",
    page_type: 0,
  },
  children: [PayRouteChildComponent],
};
